package com.turing.post.webservice.impl;

import java.util.Hashtable;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.turing.post.datatranfer.util.CardControlBusiness;
import com.turing.post.util.PCPSApplicationException;

public class MakeCardTest {
	/**
	 * @param args
	 * @throws InterruptedException 
	 */
	@SuppressWarnings("unchecked")
	public static void main(String[] args) throws InterruptedException {
		
		// 用户登录成功信息检测
		Context ctx = null;
		// 根据客户端传来的名字查找相应的实现EJB
		CardControlBusiness dao = null;
		String name = "datatranfer.impl.CardControlBusinessImpl" + "#"
				+ CardControlBusiness.class.getName();

		Hashtable env = new Hashtable();
		env.put(InitialContext.INITIAL_CONTEXT_FACTORY,
				"weblogic.jndi.WLInitialContextFactory");
		env.put(InitialContext.PROVIDER_URL, "t3://192.168.1.124:7001");

		try {
			ctx = new InitialContext(env);
		} catch (NamingException e1) {
			e1.printStackTrace();
		}

		try {
			dao = (CardControlBusiness) ctx.lookup(name);
		} catch (NamingException e) {
			e.printStackTrace();
		}
		//961880134072 最初批次号 最终批次号961880134129 
		String issuecompanyno = "961855";
		String cardManufactureId = "1482"; //137401
		String cardFaceId="1487";
			System.out.println("开始了");
			try {
				dao.insertMakeCardControl(issuecompanyno, cardManufactureId, cardFaceId);
			} catch (PCPSApplicationException e) {
				e.printStackTrace();
			}
			System.out.println("结束了");
		
	}

	@SuppressWarnings("unused")
	private static String StrFro(String batchNo, Integer i) {
		return batchNo + String.format("%06d", i);
	}
}
